package com.sunmouse.toollib.utils.region;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * Created by Kvin on 2017/5/26.
 */
public class CityBean implements Parcelable {
    private String name;
    private List<DistrictBean> districtList;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<DistrictBean> getDistrictList() {
        return districtList;
    }

    public void setDistrictList(List<DistrictBean> districtList) {
        this.districtList = districtList;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.name);
        dest.writeTypedList(this.districtList);
    }

    public CityBean() {
    }

    protected CityBean(Parcel in) {
        this.name = in.readString();
        this.districtList = in.createTypedArrayList(DistrictBean.CREATOR);
    }

    public static final Parcelable.Creator<CityBean> CREATOR = new Parcelable.Creator<CityBean>() {
        @Override
        public CityBean createFromParcel(Parcel source) {
            return new CityBean(source);
        }

        @Override
        public CityBean[] newArray(int size) {
            return new CityBean[size];
        }
    };
}
